module(..., package.seeall) -- 使得文件中的函数在何处都可调用

require "pins"

local function gpioIntHandle(msg)
    if msg == cpu.INT_GPIO_POSEDGE then
        log.info("SIM_RESET", "插卡")
        rtos.notify_sim_detect(1, 1)
    else
        log.info("SIM_RESET", "拔卡")
        rtos.notify_sim_detect(1, 0)
    end
end

pins.setup(22, gpioIntHandle, pio.PULLDOWM)
